#include <stdio.h>
#include <math.h>

int main() {
    int pointCnt; scanf("%d", &pointCnt);
    double arrX[pointCnt], arrY[pointCnt];
    double sumX = 0, sumY = 0;
    for (int i = 0; i < pointCnt; i++){
        scanf("%lf%lf", &arrX[i], &arrY[i]);
        sumX += arrX[i];
        sumY += arrY[i];
    }
    double avgX = sumX / pointCnt;
    double avgY = sumY / pointCnt;
    // 最小二乘法
    double son, parent;
    for (int i = 0; i < pointCnt; i++){
        son += (arrX[i] - avgX) * (arrY[i] - avgY);
        parent += pow(arrX[i] - avgX, 2);
    }
    double b = son / parent;
    double a = avgY - b * avgX;
    printf("Y=%.4lf+%.4lf*X", a, b);
    return 0;
}